<template>
  <div style="padding: 0px 10px;">
    <el-tabs v-model="activeNameBlockT" @tab-click="handleClickBlckT">
      <el-tab-pane label="待办事项" name="myToDo">
        <busi-work-flow-to-do></busi-work-flow-to-do>
      </el-tab-pane>
      <el-tab-pane label="已办事项" name="myHasToDo">
        <busi-work-flow-has-to-do v-if="isShowHasToDo"></busi-work-flow-has-to-do>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import { busiWorkFlowToDo, busiWorkFlowHasToDo } from '@/views/workFlowManage/busiWorkFlowTask/components'

export default {
  name: 'busiWorkFlowTaskList',
  data() {
    return {
      // 刚进页面时，不加载已办
      loadNo: 0,
      isShowHasToDo: false,
      activeNameBlockT: 'myToDo'
    }
  },
  watch: {
    // 普通的watch监听通的watch监听
  },
  computed: {
  },
  filters: {

  },
  components: {
    busiWorkFlowToDo,
    busiWorkFlowHasToDo
  },
  /**
   * 组件创建完成后，查询列表数据
   */
  created() {
    //
  },
  mounted() {
    //
    // this.loadNo++
    // alert(this.loadNo)
  },
  methods: {
    // tab点击
    handleClickBlckT(tab, event) {
      // 加载已办
      if (!this.isShowHasToDo && tab.name === 'myHasToDo') {
        this.isShowHasToDo = true
      }
    }
  }
}
</script>
<style scoped>
</style>

